//
//  Player.m
//  GuessingGame
//
//  Created by admin on 2019/7/30.
//  Copyright © 2019 猫爷爷的酱醋茶. All rights reserved.
//

#import "Player.h"

@implementation Player

-(void)MoraAction
{
    //提示用户出拳
    NSLog(@"\n\n亲爱的玩家 %@，请选择你要出的拳头：1.剪刀 2.石头 3.布\n\n",_name);
    
    //接收用户出拳
    int userSelect = 0;
    scanf("%d",&userSelect);
    
    NSString *select = [self MoraTypeWithNumber:userSelect];
    
    system("clear");
    //显示用户出拳
    NSLog(@"\n\n玩家「%@」出的拳头是:%@\n\n",_name,select);
    
    //将用户选择的拳头存储在当前对象的属性中
    _select = userSelect;
}

-(NSString *)MoraTypeWithNumber:(int)number
{
    switch (number) {
        case 1:
            return @"剪刀";
        case 2:
            return @"石头";
        case 3:
            return @"布";
        case 0:
            return @"0";
    
        default:
            return @"请重新确认您要出的拳头！";
    }
    
}

@end
